﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XbsWebAPI.Application;
using XbsWebAPI.Application.SystemAdmin.Dtos;
using XbsWebAPI.EntityFrameworkCore.Entities;
using XbsWebAPI.EntityFrameworkCore.Entities.SystemAdmin;

namespace XbsWebAPI.Core.Repositories
{
    /// <summary>
    /// 菜单 应用服务层
    /// </summary>
    public interface IMenuAppService
    {
        /// <summary>
        /// 组装菜单（包含1级、2级）
        /// </summary>
        public ResultDto<List<ListMenu>> CompositionMenus();

        public Task<ResultDto<string>> AddMenusAsync(Menu model);

        public ResultDto<List<Menu>> GetMenus(MenuType? menuType);

        ResultDto<Menu> GetMenuById(Guid id);

        Task<ResultDto<string>> CreateMenuAsync(CreateMenuDto model);

        Task<ResultDto<string>> UpdateMenuAsync(EditMenuDto model);

        Task<ResultDto<string>> RemoveMenuByIdAsync(Guid id);

        /// <summary>
        /// 获取父级菜单
        /// </summary>
        /// <returns></returns>
        ResultDto<List<Menu>> GetParentMenus();

        /// <summary>
        /// 根据父级菜单Id获取二级菜单
        /// </summary>
        /// <param name="parentMenuId"></param>
        /// <returns></returns>
        ResultDto<List<Menu>> GetChildMenus(Guid parentMenuId);

        /// <summary>
        /// 根据二级菜单Id获取对应按钮集合
        /// </summary>
        /// <param name="childMenuId"></param>
        /// <returns></returns>
        ResultDto<List<Menu>> GetButonMenus(Guid childMenuId);
    }
}
